#include "Domino.h"
#include "HavokWorld.h"


Domino* TheDomino::domino = 0;

void Domino::Init(D3DXVECTOR3 pos)
{
	Position = pos;
	AllignDomino();
}
void Domino::AllignDomino()
{
	DominoBlocks* pBlock = 0;

	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x,Position.y,Position.z ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x,Position.y,Position.z+30 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x,Position.y,Position.z+60 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x,Position.y,Position.z+90 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x,Position.y,Position.z+120 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-8,Position.y,Position.z+140 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-25,Position.y,Position.z+150 ),D3DXVECTOR3(0,90,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-40,Position.y,Position.z+140 ),D3DXVECTOR3(0,45,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-45,Position.y,Position.z+120 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-47,Position.y,Position.z+90 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-49,Position.y,Position.z+60 ),D3DXVECTOR3(0,0,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-56,Position.y,Position.z+40 ),D3DXVECTOR3(0,45,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-70,Position.y,Position.z+35 ),D3DXVECTOR3(0,90,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-90,Position.y,Position.z+45 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-110,Position.y,Position.z+55 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-130,Position.y,Position.z+65 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-140,Position.y,Position.z+75 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-155,Position.y,Position.z+85 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);
	pBlock = new DominoBlocks(D3DXVECTOR3(Position.x-170,Position.y,Position.z+105 ),D3DXVECTOR3(0,135,0),D3DXVECTOR3(15,35,5));
	pBlock->AddObjectToSimulation(HavokWorld::Get().physicsWorld);
	pBlock->bodyInfo.m_mass=500.0f;
	pBlock->havokRigidBody->setName("BLOCKS");
	Objects.push_back(pBlock);


}